package Demo3;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 洪汤泽大帅哥
 * Date: 2024-12-22
 * Time: 9:45
 */
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        String str = "";
        for (int i = 0; i < s.length(); i++) {
            char ch = s.charAt(i);
            if (ch>'a'&&ch<='z'){
                ch = (char) (ch-32);
            } else if (ch>'A'&&ch<'Z') {
                ch = (char) (ch+32);
            }
            str += ch;
        }
        StringBuilder stringBuilder =new StringBuilder(str);
        System.out.println(stringBuilder.reverse());
    }
}
